<?php

use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */

/* @var $model \yii\db\ActiveRecord */
$model = new $generator->modelClass();
$safeAttributes = $model->safeAttributes();
if (empty($safeAttributes)) {
    $safeAttributes = $model->attributes();
}

echo "<?php\n";
?>

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
/* @var $form yii\widgets\ActiveForm */
?>


    <?= "<?php " ?>$form = ActiveForm::begin([
            'fieldConfig' => [
                'template' => "{label}\n<div class=\"col-sm-10  col-sm-6\">{input}<label class='error'>{error}</label></div>",
                'labelOptions' => ['class' => 'col-sm-2 bx_label'],
            ],
        ]); ?>
<div class="ibox-content">
<?php foreach ($generator->getColumnNames() as $attribute) {
    if (in_array($attribute, $safeAttributes)) {
        echo "    <?= " . $generator->generateActiveField($attribute) . " ?>\n\n";
    }
} ?>
    <div class="form-group">
        <div class="col-sm-8  col-sm-offset-2">
            <?= "<?= " ?>Html::submitButton($model->isNewRecord ? <?= $generator->generateString('提交') ?> : <?= $generator->generateString('更新') ?>, ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
        </div>
    </div>
</div>
    <?= "<?php " ?>ActiveForm::end(); ?>

